package com.heima.wemedia.controller;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.media.dtos.WmUserDto;
import com.heima.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/wmuser")
public class WmUserController {

    @Autowired
    private WmUserService wmUserService;

    //保存自媒体用户
    @PostMapping("/save")
    public Integer save(@RequestBody WmUserDto dto){
        return wmUserService.saveWmUser(dto);
    }

    //根据app用户id查询自媒体用户
    @GetMapping("/findByApUserId/{apUserId}")
    public WmUserDto findByApUserId(@PathVariable Integer apUserId){
        return wmUserService.findByApUserId(apUserId);
    }

}
